#!/system/bin/sh

while [ true ]
do
	dumpsys activity services | grep "com.example.x6.configurationmaintenance/.Service.RebootService" > /dev/null
	#ps | grep "com.example.x6.configurationmaintenance"
	if [ $? -ne 0 ]; then
		am startservice -n com.example.x6.configurationmaintenance/com.example.x6.configurationmaintenance.Service.RebootService
		#am startservice -n com.example.x6.configurationmaintenance/com.example.x6.configurationmaintenance.Service.ServiceDaemonService
	fi

	dumpsys activity services | grep "com.example.x6.configurationmaintenance/.Service.ServiceDaemonService" > /dev/null
    if [ $? -ne 0 ]; then
        am startservice -n com.example.x6.configurationmaintenance/com.example.x6.configurationmaintenance.Service.ServiceDaemonService
    fi
	sleep 2;
done
